local sk__cunsi = fk.CreateSkill {

  name = "sk__cunsi",

  tags = {  },

}



sk__cunsi:addEffect(fk.Death, {
  name = "sk__cunsi",
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self, false, true)
  end,
  on_cost = function(self, event, target, player, data)
    local to = player.room:askForChoosePlayers(player, table.map(player.room.alive_players, Util.IdMapper), 1, 1,
      "#sk__cunsi-choose", sk__cunsi.name, true)
    if #to > 0 then
      event:setCostData(self, to[1])
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local to = room:getPlayerById(event:getCostData(self))
    room:handleAddLoseSkills(to, "sk__yongjue", nil, true, false)
    if not to.dead and not player:isAllNude() then
      to:addToPile(sk__cunsi.name, player:getCardIds("hej"), false, sk__cunsi.name, player.id)
    end
  end,
})

return sk__cunsi